From: Jasper St. Pierre Date: Thu, 24 Mar 2011 11:09:04 +0000 (-0400) Subject: telepathyClient: insert a timestamp between log messages and pending messages X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8426 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b2a2a00cd8284d3b422122252918714e05922000;p=gnome-shell.git telepathyClient: insert a timestamp between log messages and pending messages This will give a visual break, giving a bit of clarity when a message is received from a new contact. https://bugzilla.gnome.org/show_bug.cgi?id=645609 --- diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js index b59c0581c..675181a26 100644 --- a/js/ui/telepathyClient.js +++ b/js/ui/telepathyClient.js @@ -249,6 +249,8 @@ Source.prototype = { let pendingTpMessages = this._channel.get_pending_messages(); let pendingMessages = pendingTpMessages.map(function (tpMessage) { return makeMessageFromTpMessage(tpMessage, NotificationDirection.RECEIVED); }); + let showTimestamp = false; + for (let i = 0; i < logMessages.length; i++) { let logMessage = logMessages[i]; let isPending = false; @@ -262,17 +264,18 @@ Source.prototype = { } } - if (!isPending) + if (!isPending) { + showTimestamp = true; this._notification.appendMessage(logMessage, true); + } } + if (showTimestamp) + this._notification.appendTimestamp(); + for (let i = 0; i < pendingMessages.length; i++) this._notification.appendMessage(pendingMessages[i], true); - // Only show the timestamp if we have at least one message. - if (pendingMessages.length > 0 || logMessages.length > 0) - this._notification.appendTimestamp(); - if (pendingMessages.length > 0) this.notify(); },